<?php

declare(strict_types=1);

namespace App\Validations;

/**
 * Define las reglas de validación de los contactos.
 */
class ContactValidation extends BaseValidation
{
    public function getAllRules(): array
    {
        return [
            'id' => ['guidv4'],
            'user_id' => ['guidv4'],
            'fullname' => ['max_len' => 128],
            'phone' => ['phone_number', 'max_len' => 16],
            'email' => ['valid_email', 'max_len' => 128],
            'company' => ['max_len' => 128],
            'photo' => ['is_image'],
            'website' => ['valid_url'],
            'birthday' => ['date' => 'Y-m-d'],
            'notes' => ['max_len' => 255],
        ];
    }

    public function getAllFilters(): array
    {
        return [
            'fullname' => ['trim'],
            'email' => ['lower_case'],
            'company' => ['trim'],
            'notes' => ['trim'],
        ];
    }
}
